const admin = require('express');

var router = admin.Router();

//检查登录状态
router.use(function(req,res,next){
    if( !req.session['admin'] && req.url != '/login' )
    {
        res.redirect('/admin/login');
    }else{
        next();
    }
})

router.use( '/banner',require( './admin/banner' ));
router.use('/login',require( './admin/login' ));
router.use( '/',require( './admin/index' ) );






module.exports = router;